<?php
/**
 * 系统工具类
 */

class usersystem {
	// 过滤非法字符
	static function _addslashes($arr) {
		if (is_string($arr)) {
			if (config :: create() -> systems['safty'] == '0') {
				$arr = get_magic_quotes_gpc()?stripslashes($arr):$arr;
			} else {
				$arr = get_magic_quotes_gpc()?$arr:addslashes($arr);
			} 
		} elseif (is_array($arr)) {
			foreach($arr as $k => $v) {
				$arr[$k] = self :: _addslashes($v);
			} 
		} 
		return $arr;
	}

        static function array_get($array_date,$break,$bool = false){
                static $str;
                foreach($array_date as $key=>$val){
                        if(end($array_date) == $val){
                                $break = '';
                        }
                        if($bool){
                                $str .= $key . $break;
                        }else{
                                $str .= $val . $break;
                        }
                }
                return $str;
        }
        static function array_get_i($array_date,$break,$keyword){
                static $str;
                foreach($array_date as $key=>$val){
                        if(end($array_date) == $val){
                                $break = '';
                        }
                        $str .= $key . $keyword . $val . $break;
                }
                return $str;
        }
} 

?>